package com.firefightingiot.firefightingiot.web.mapper;

import cn.hutool.json.JSONObject;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.firefightingiot.firefightingiot.model.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

@Mapper
public interface DeviceBusinessMapper extends BaseMapper<DeviceBusiness> {

    IPage<DeviceBusiness> deviceListPage(IPage page, @Param("param") JSONObject jsonParam);


    DeviceBusiness getByParam(JSONObject jsonParam);

    /**
     *
     * @Title: insertZB <br>
     * @Description: (添加到DeviceBusiness中) <br>
     * @author 石延杰<br>
     * @param params
     */
    void insertZB(List<DeviceBusiness> list);

    DeviceBusiness getDeviceBusinessById(JSONObject jsonParam);

    void updateCurrentstateByNumbers(JSONObject jsonParam);

    void updateToOffForFire(@Param("param") JSONObject jsonParam);

    void updateLedFD( JSONObject jsonParam);

    void updateToOffForWater(@Param("param") JSONObject jsonParam);

    void updateToOffForGas(@Param("param") JSONObject jsonParam);

    Integer getDeviceCount(@Param("param") JSONObject jsonObject);

    /**
     * 导出设备列表
     * @param jsonParam
     * @return
     */
    List<LinkedHashMap<String, String>> getDeviceList(@Param("param") JSONObject jsonParam);
    List<LinkedHashMap<String, String>> getDeviceNewList(@Param("param") JSONObject jsonParam);
    List<String> getNumbersByAlarmType(@Param("param") JSONObject jsonParam);

    List<String> getNumbersByDeviceType(@Param("param") JSONObject jsonParam);

    Integer updateOrgId(JSONObject jsonParam);

    Integer updateIotNumber(JSONObject jsonParam);
    //查询死锁问题
    List<String> getLock(JSONObject jsonParam);
    //处理死锁问题
    void updateForKillLock(JSONObject jsonParam);

    void updateToOffForWaterPump(JSONObject jsonObject);

    void updateToOffForSmoke(JSONObject jsonObject);

    void updateToOffForHx100(@Param("param") JSONObject jsonParam);

    void updateToOffForWaterColumn(JSONObject jsonObject);
    List<DeviceBusiness> getDeviceListZB(@Param("param") JSONObject jsonParam,List<JSONObject> list);

    /**
     * @Author YangYu
     * @Description 查询维保设备号
     * @Date Created in 15:18 2022/9/13
     * @Param []
     */

    List<String> getMaintenanceDeviceNumber();

    /**
     * @Author YangYu
     * @Description 维保设备批量插入
     * @Date Created in 15:24 2022/9/13
     * @Param [list]
     */

    void insertZBMaintenanceDevice(List<MaintenanceDevice> list);

    /**
     * 批量插入单位
     * @param list
     */
    void insertBusinessZB(List<Business> list);
    /**
     * 获取机构ID、AllID
     */
    List<Map<String,Object>> getOrgList();

    void batchUpdateVisualizationDeviceState(List<DeviceAlarmLog> list);

    List<DeviceBusiness> getDeviceStateCount(JSONObject jsonParam);

    List<DeviceBusiness> getDeviceClassifyCount(JSONObject jsonParam);

    Integer getBusinessCount(String orgId);

    /**
     * 获取账号权限
     */
    List<String> getUserPer(String userId);
    /**
     * 获取单位详情
     */
    Business getBusiness(String Id);
    /**
     * 获取设备号
     */
    List<String> getNumber();
}
